<form id="pagerForm" action="${url}" method="post">
	<input type="hidden" name="curPage" value="${curPage}" />
	<input type="hidden" name="pageSize" value="${pageSize}" />
 	<div class="page clearfloat"> 
  		<div class="<%if(curPage <= 1){%>page-first<%}else{%>page-left<%}%>"><s></s>
  			<%if(curPage <= 1){%><span>上一页</span>
  			<%}else{%>
  			<span><a href="<%if(curPage==2){%>${url}<%}else{%>${url}${curPage-1}<%}%>">上一页</a></span>
  			<%}%>
  		</div> 
  		<ul class="page-midul">
		<%if(countpages<=5){%>
  			<%for(var i=1;i<=countpages;i++){%>
  				<%if(curPage==i){%>
  				<li class="select"><span>${i}</span></li>
  				<%}else{%>
  				<li><a href="${url}<%if(i>1){%>${i}<%}%>">${i}</a></li>
  				<%}%>
  			<%}%>
  		<%}else{%>
  			<%if(curPage==1){%>
  				<li class="select"><span>1</span></li>
  			<%}else{%>
  				<li><a href="${url}1">1</a></li>
  			<%}%>
  			<%
  				var startNum = 2;
  				var endNum=curPage;
  				if(curPage+2>=countpages){
  					endNum = countpages-1;
  				}else{
  					endNum = curPage+2;
  				}
  			%>
			<%if(curPage>=6){startNum = curPage-2;%>
				<li><span>...</span></li>		
			<%}%>
  			<%for(var i = startNum;i<=endNum;i++){%>
				<%if(curPage==i){%>
					<li class="select"><span>${i}</span></li>
				<%}else{%><li><a href="${url}<%if(i>1){%>${i}<%}%>">${i}</a></li><%}%>
			<%}%>
			<%if(curPage+3<countpages){%>
				<li><span>...</span></li>
			<%}%>
  			<%if(curPage==countpages){%>
  				<li class="select"><span>${countpages}</span></li>
  			<%}else{%>
  				<li><a href="${url}${countpages}">${countpages}</a></li>
  			<%}%>
		<%}%>
  		</ul> 
		<div class="<%if(curPage>=countpages){%>page-last<%}else{%>page-rig<%}%>">
		   	<span><%if(curPage>=countpages){%>下一页<%}else{%><a href="${url}${curPage+1}">下一页</a><%}%></span>
		   	<s></s>
		</div> 
	</div> 
</form>
<script type="text/javascript">
	$(function(){
		$(".page-midul").find("li").bind("click",function(){
			reload($(this).find("a").attr("href"));
		});
		$(".page-left").bind("click",function(){
			reload($(this).find("a").attr("href"));
		});
		$(".page-rig").bind("click",function(){
			reload($(this).find("a").attr("href"));
		});
	});
	function reload(href){
		if(href && href.indexOf('javascript') == -1 && href.indexOf('click') == -1){
			location.href = href;
		}
	}
</script>